/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-18 07:14:35
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-18 11:14:35
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/controller/wristband_controller.dart';
import 'package:get/get.dart';
import 'components/wirstband_detail_chart.dart';
import 'components/wirstband_detail_map.dart';
import 'components/wristband_detail_card.dart';
import 'components/wristband_detail_card_list.dart';

class WristbandDetailScreen extends StatefulWidget {
  const WristbandDetailScreen({Key key, this.tag}) : super(key: key);
  static String routeName = "/wristband_detail";
  final String tag;

  @override
  _WristbandDetailScreenState createState() => _WristbandDetailScreenState();
}

class _WristbandDetailScreenState extends State<WristbandDetailScreen> {
  WristbandController _wristbandController = Get.put(WristbandController());
  void initState() {
    super.initState();
    // 发起网络请求
    _wristbandController.getDetail();
  }

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.transparent,
          title: Text("手环"),
          elevation: 0,
        ),
        body: SafeArea(
          child: SingleChildScrollView(
            child: Padding(
              padding: EdgeInsets.symmetric(horizontal: 30),
              child: Column(
                children: [
                  WristbandDetailCard(tag: widget.tag),
                  SizedBox(height: 20),
                  WristbandDetailCardList(),
                  SizedBox(height: 20),
                  WristbandDetailChart(),
                  SizedBox(height: 20),
                  WristbandDetailMap(),
                ],
              ),
            ),
          ),
        ),
      );
}
